package com.zhangqi.qiojbackendjudgeservice.controller.inner;


import com.zhangqi.qiojbackendjudgeservice.JudgeService;
import com.zhangqi.qiojbackendmodel.entity.QuestionSubmit;
import com.zhangqi.qiojbackendserviceclient.service.JudgeFeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/inner")
public class JudgeFeignController implements JudgeFeignClient {

    @Resource
    private JudgeService judgeService;
    /**
     * 判题
     * @param questionSubmitId
     * @return
     */
    @Override
    @PostMapping("/do")
    public QuestionSubmit doJudge(@RequestParam("questionSubmitId")long questionSubmitId){
        return judgeService.doJudge(questionSubmitId);
    }
}
